package cn.like.entity;

import cn.like.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 系统日志(CommonOptLog)表实体类
 *
 * @author like
 * @since 2021-07-08 15:59:15
 */
@Data
@TableName("common_opt_log")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "系统日志")
@SuppressWarnings("serial")
public class CommonOptLog extends BaseEntity<CommonOptLog> {
	
	public static final String id_col_name = "id";
	public static final String requestIp_col_name = "request_ip";
	public static final String type_col_name = "type";
	public static final String userName_col_name = "user_name";
	public static final String description_col_name = "description";
	public static final String classPath_col_name = "class_path";
	public static final String actionMethod_col_name = "action_method";
	public static final String requestUri_col_name = "request_uri";
	public static final String httpMethod_col_name = "http_method";
	public static final String params_col_name = "params";
	public static final String result_col_name = "result";
	public static final String exDesc_col_name = "ex_desc";
	public static final String exDetail_col_name = "ex_detail";
	public static final String startTime_col_name = "start_time";
	public static final String finishTime_col_name = "finish_time";
	public static final String consumingTime_col_name = "consuming_time";
	public static final String ua_col_name = "ua";
	public static final String createTime_col_name = "create_time";
	public static final String createUser_col_name = "create_user";
	
	
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键")
	@NotNull(message = "id不能为空")
	private Long id;
	
	/**
	 * 操作IP
	 */
	@ApiModelProperty(value = "操作IP")
	private String requestIp;
	
	/**
	 * 日志类型
	 * #LogType{OPT:操作类型;EX:异常类型}
	 */
	@ApiModelProperty(value = "日志类型#LogType{OPT:操作类型;EX:异常类型}")
	private String type;
	
	/**
	 * 操作人
	 */
	@ApiModelProperty(value = "操作人")
	private String userName;
	
	/**
	 * 操作描述
	 */
	@ApiModelProperty(value = "操作描述")
	private String description;
	
	/**
	 * 类路径
	 */
	@ApiModelProperty(value = "类路径")
	private String classPath;
	
	/**
	 * 请求方法
	 */
	@ApiModelProperty(value = "请求方法")
	private String actionMethod;
	
	/**
	 * 请求地址
	 */
	@ApiModelProperty(value = "请求地址")
	private String requestUri;
	
	/**
	 * 请求类型
	 * #HttpMethod{GET:GET请求;POST:POST请求;PUT:PUT请求;DELETE:DELETE请求;PATCH:PATCH请求;TRACE:TRACE请求;HEAD:HEAD请求;OPTIONS:OPTIONS请求;}
	 */
	@ApiModelProperty(value = "请求类型#HttpMethod{GET:GET请求;POST:POST请求;PUT:PUT请求;DELETE:DELETE请求;PATCH:PATCH请求;TRACE:TRACE请求;HEAD:HEAD请求;OPTIONS:OPTIONS请求;}")
	private String httpMethod;
	
	/**
	 * 请求参数
	 */
	@ApiModelProperty(value = "请求参数")
	private Object params;
	
	/**
	 * 返回值
	 */
	@ApiModelProperty(value = "返回值")
	private Object result;
	
	/**
	 * 异常详情信息
	 */
	@ApiModelProperty(value = "异常详情信息")
	private Object exDesc;
	
	/**
	 * 异常描述
	 */
	@ApiModelProperty(value = "异常描述")
	private Object exDetail;
	
	/**
	 * 开始时间
	 */
	@ApiModelProperty(value = "开始时间")
	private LocalDateTime startTime;
	
	/**
	 * 完成时间
	 */
	@ApiModelProperty(value = "完成时间")
	private LocalDateTime finishTime;
	
	/**
	 * 消耗时间
	 */
	@ApiModelProperty(value = "消耗时间")
	private Long consumingTime;
	
	/**
	 * 浏览器
	 */
	@ApiModelProperty(value = "浏览器")
	private String ua;
	/**
	 * 创建人id
	 */
	@ApiModelProperty(value = "创建人id")
	@TableField(fill = FieldFill.INSERT)
	private Long createUser;
	
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;
}